import 'package:intl/intl.dart';

extension FromTime on String {
  ///将时间戳转换为日期格式
  toDateTime() {
    if(isEmpty) return "";
    final time = DateTime.fromMillisecondsSinceEpoch(int.parse(this)*1000);
    return DateFormat('yyyy-MM-dd HH:mm:ss').format(time);
  }
}